<?php
$con=mysqli_connect("localhost","root","","sc");
if (mysqli_connect_errno())
{
    echo "连接失败: " . mysqli_connect_error();
}

$result = mysqli_query($con,"SELECT name FROM Student
WHERE '18' <= age <='22'");

while($row = mysqli_fetch_array($result))
{
    echo $row['name'];
    echo "<br>";
}
mysqli_query($con,"UPDATE Student SET id='081'
WHERE id='001'");
    echo "<br>";
$result = mysqli_query($con,"SELECT id,name FROM Lesson
WHERE lesson_id = '5'");
while($row = mysqli_fetch_array($result))
{
    echo $row['id'].' '.$row['name'];
    echo "<br>";
}
$result1 = mysqli_query($con,"SELECT id,mark FROM Seletive_lesson ORDER BY mark DESC");

while($row = mysqli_fetch_array($result1))
{
    echo $row['id'].' ',$row['mark'];
    echo "<br>";
}
mysqli_query($con,"DELETE FROM Student WHERE id='002'");
mysqli_query($con,"ALTER TABLE Student ADD address char(20);");
$sql = "DROP TABLE Seletive_lesson";
mysqli_select_db( $con, 'sc' );
$retval = mysqli_query( $con, $sql );
if(! $retval )
{
  die('数据表删除失败: ' . mysqli_error($conn));
}
echo "数据表删除成功\n";
$result2 = mysqli_query($con,"SELECT * FROM Seletive_lesson
WHERE lesson_id = '5'");

if($row = mysqli_fetch_array($result2))
{
    echo "有！";
    echo "<br>";
}
else
	echo "没有！";
echo "<br>";
//不会了不会了。。
mysqli_close($con);
?>